//
//  GCUserTableViewCell.m
//  GoldChampion
//
//  Created by stoneobs on 2018/5/17.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "MCFriendApplyTableViewCell.h"

@interface MCFriendApplyTableViewCell()
@property(nonatomic, strong) UIImageView              *iconImageView;
@property(nonatomic, strong) STLabel              *nameLable;
@property(nonatomic, strong) STLabel                     *noteLable;/**< 备注 */
@property(nonatomic, strong) STLabel                     *statusLable;/**< 状态lable */
@end
@implementation MCFriendApplyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 60;
}
#pragma mark --subView
- (void)configSubView{
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0, 50, 50)];
    self.iconImageView.layer.cornerRadius = 25;
    self.iconImageView.clipsToBounds = YES;
    self.iconImageView.centerY = self.class.cellHeight/2;
    self.iconImageView.image = [UIImage imageNamed:@"reba1"];
    [self addSubview:self.iconImageView];
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top, 200, 20)
                                                     text:@"dsdas"
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:titleLable];
    self.nameLable = titleLable;
    
    self.noteLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top, 200, 20)
                                                     text:@"dsdas"
                                                textColor:SecendTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    self.noteLable.bottom = self.iconImageView.bottom;
    [self addSubview:self.noteLable];

    
    self.applyButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 40, 30)
                                                     title:@"同意"
                                                titleColor:TM_ThemeBackGroundColor
                                                 titleFont:14
                                              cornerRadius:0
                                           backgroundColor:nil
                                           backgroundImage:nil
                                                     image:nil];
    self.applyButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    self.applyButton.centerY = self.nameLable.centerY;
     self.applyButton.right = UIScreenWidth - 15;
    [self addSubview:self.applyButton];
    
    self.refuseButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 40, 30)
                                                 title:@"取消"
                                            titleColor:SecendTextColor
                                             titleFont:14
                                          cornerRadius:0
                                       backgroundColor:nil
                                       backgroundImage:nil
                                                 image:nil];
    self.refuseButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    self.refuseButton.centerY = self.nameLable.centerY;
     self.refuseButton.right = self.applyButton.left - 10;
    [self addSubview:self.refuseButton];
    
    
    
    self.statusLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top, 200, 20)
                                               text:@"已拒绝"
                                          textColor:SecendTextColor
                                               font:15
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentRight];
    self.statusLable.centerY = self.class.cellHeight;
    self.statusLable.hidden = YES;
    self.statusLable.right = UIScreenWidth - 15;
    [self addSubview:self.statusLable];
    
}
- (void)setUser:(MCUserModel *)user{
    _user = user;
    
    [self.iconImageView sd_setImageWithURL:MCRealImageUrl(user.user_icon) completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        
    }];
    self.nameLable.text = user.user_nick;
}
@end



